package cn.lynu.study.practice11_30;

class MyRunnable1 implements Runnable{
	
	
	@Override
	public void run() {
		int var1=0;
		String threadName = Thread.currentThread().getName();
		while(true) {

			System.out.println(threadName+"var1="+var1);
			var1++;
			try {Thread.sleep(1000);
			} catch (InterruptedException e) {
				e.printStackTrace();}
		}
	}
	
	}
public class Test01 {
	public static void main(String[] args) {
		MyRunnable1 myRunnable = new MyRunnable1();
		Thread t1 = new Thread(myRunnable,"t1߳");
		Thread t2 = new Thread(myRunnable,"t2߳");
		Thread t3 = new Thread(myRunnable,"t3߳");	
		t1.start();
		t2.start();
		t3.start();
	}
}
